import 'package:azlistview/azlistview.dart';
import 'package:library_base/entities/generated/json/base/json_field.dart';
import 'package:library_base/entities/generated/json/location_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class LocationEntity extends ISuspensionBean {
  late String id;
  late String locationName;

  String? tagIndex;
  String? namePinyin;

  bool isSelect = false;

  LocationEntity();

  @override
  String getSuspensionTag() => tagIndex!;

  factory LocationEntity.fromJson(Map<String, dynamic> json) =>
      $LocationEntityFromJson(json);

  Map<String, dynamic> toJson() => $LocationEntityToJson(this);

  @override
  String toString() => json.encode(this);

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is LocationEntity &&
          runtimeType == other.runtimeType &&
          id == other.id;

  @override
  int get hashCode => id.hashCode;
}
